<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
export default {
  mixins: [
    Vue.prototype.$vFN.Mixins.Base,
    Vue.prototype.$vFN.Mixins.Page,
    Vue.prototype.$vFN.Mixins.Table,
  ],
  data() {
    return {
      appWindow: window,
      // 页面接口地址
      apiUrl: {
        list: "plugin/team-dividend/admin/order/list",
      },
      // 列表常量查询参数
      mixinTable_tableSearchConst: {
        income_status: 0,
      },
      // 列表动态查询参数
      mixinTable_tableSearchData: {
        order_no: "",
      },

      options: [],
      //  大于 等于 4个字符
      pattern: /^\d{4,}$/
    };
  },
  methods: {
  
    // 搜索前
    mixinTable_getTableValidate(data_){
      // order_no 大于 等于 4个字符
      if(!this.$vFN.Utils.isEmpty(data_.data.order_no) && data_.data.order_no.length<4){
          this.$vFN.Tools.messageError("请输入大于等于4个数字订单号");
          return false;
      }else{
          return true;
      } 

   },

    async getdata() {
      let res = await this.$vFN.Http.post({
        url: "plugin/team-dividend/admin/order/orderDropList",
      },window);
      this.options = res.data;
    }, 
    // 初始化
    async init() {
      await this.getdata();
      this.mixinTable_refreshData();
    },
  },
  mounted() {
    this.init();
  },
  filters: {
    stateText: function(value){
      let text;
      switch(parseInt(value)){
        case 1:
          text = '预计收益'
          break;
        case 2:
          text = '待结算收益'
          break;
        case 3:
          text = '已结算收益'
          break;
        case 4:
          text = '失效收益'
          break;
          default:
          text = '异常' 
      }
     
      return text;
    },
    typeText: function(value){
      let text;
    switch(parseInt(value)){
        case 1:
          text = '队长分红'
          break;
        case 2:
          text = '平级奖励'
          break;
        case 3:
          text = '育人奖励'
          break;
        case 4:
          text = '越级奖励'
          break;
        case 5:
          text = '感恩奖'
          break;
          default:
          text = '异常' 
      }
      return text;
    },
  },
  activated() {},
};
</script>